Handle `rev` being a `tag`
authorAlex Crichton <alex@alexcrichton.com>
Mon, 23 Jan 2017 17:25:14 +0000 (09:25 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 23 Jan 2017 17:25:14 +0000 (09:25 -0800)
commitc0cc8ffe24ff795b9d0d5ca9da57485049fd3c97
tree9b3061ac8e9a03abb161d5ebf4d4fa585db84026
parent41accdfd03666404a1b95cc4e070877c84e15033
Handle `rev` being a `tag`

Previously if a rev was specified as a tag then we'd trip an assertion because
resetting to that tag would reset to the tag that the commit pointed to, which
would then cause the head id of the repo to be different than what we thought it
was.

Instead, we handle the case where a `rev` specification is a tag explicitly by
using the tag's target id as the revision that we're going to check out, not the
id of the tag itself.

Closes #3580
src/cargo/sources/git/utils.rs
tests/git.rs